import constant


class edge(object):
    def __init__(self,from_point_id,to_point_id,length,edge_type):
        self.from_point_id=from_point_id
        self.to_point_id=to_point_id
        self.length=length
        self.type=edge_type
        if(self.type==0):
            self.cost_time=self.length/constant.truck_speed0
        else:
            self.cost_time=self.length/constant.truck_speed1

    #     self.time_windows=[0 for i in range(200)]

    # # 增加一个时间窗
    # def add_timewind(self,start,end):
    #     for i in range(start+1,end+1):
    #         self.time_windows[i]+=1

    # # 查询一个时间窗内，返回时间窗内最大车辆数和进入该边需要等待的时间
    # def find_timewind(self,start,end):
    #     num_car=0
    #     time_point=0
    #     for i in range(start+1,end+1):
    #         if(num_car<self.time_windows[i]):
    #             num_car=self.time_windows[i]
    #             time_point=i
    #     if num_car< constant.crowd_num :
    #         return 0
    #     else:
    #         wait_time=0
    #         while(self.time_windows[time_point] >= constant.crowd_num):
    #             time_point+=1
    #         wait_time=time_point-start
    #         return wait_time

            

        


